module.exports = () => {
    return async function (ctx, next) {
     
        let params = ctx.request.querystring;
        if (params != '') {
            params = '?' + params;
        }
      
        if (ctx.helper.isMobile()) {
            ctx.redirect(`/mobile/${params}`)
        } else {
            ctx.set('cache-control','no-cache');  
            await next();
        }
    }
}